#ifndef ivertexbuffer_h__
#define ivertexbuffer_h__

namespace gecko
{

// forward declare type
class IRenderer;
class IIndexBuffer;
class Vertex;

// Abstract interface to platform specific vertex buffers.
class IVertexBuffer
{
public:
	// Primitive types
	enum ePrimitiveType
	{
		PT_POINTLIST = 1,
		PT_LINELIST = 2,
		PT_LINESTRIP = 3,
		PT_TRIANGLELIST = 4,
		PT_TRIANGLESTRIP = 5,
		PT_NUM
	};

	// Initialise the vertex buffer.
	virtual bool Initialise(IRenderer *r, unsigned int vertexCount, bool dynamic) = 0;

	// Lock the buffer prior to accessing vertex data.
	virtual bool Lock(unsigned int offset, unsigned int vertexCount, Vertex** verts) = 0;

	// Unlock the buffer after accessing vertex data.
	virtual bool Unlock() = 0;

	// Destroy the buffer and release resources.
	virtual bool Destroy() = 0;

	// Set the index buffer used to render.
	virtual bool SetIndexBuffer(IIndexBuffer *ib) = 0;

	// Render the geometry.
	virtual bool Render(ePrimitiveType primitiveType, unsigned int primitiveCount) = 0;

	// Render the geometry with an index buffer set.
	virtual bool RenderIndexed(ePrimitiveType primitiveType, unsigned int indexCount, unsigned int primitiveCount) = 0;
};

}// namespace gtapi

#endif // ivertexbuffer_h__